<?php
namespace Admin\Transformer;

use Common\ORG\Util\Transformer;

/**
 * Class ItemCateTransformer
 * @package Home\Transformer
 */
class ItemCateTransformer extends Transformer {
    public function transformer($item) {
        return [
            'id' => intval($item['id']),
            'name' => strval($item['name']),
            'status' => intval($item['status']),
            'is_enquiry' => intval($item['is_enquiry']),
            'is_schedule' => intval($item['is_schedule']),
            'create_time' => date('Y-m-d', $item['create_time']),
            'update_time' => date('Y-m-d', $item['update_time']),
            'type' => intval($item['type']),
            'pid' => intval($item['pid']),
            'parent_name' => isset($item['parent_name'])?$item['parent_name']:'',
            'depth' => intval($item['depth'])
        ];
    }
}
